const axios = require('axios');
const MockAdapter = require('axios-mock-adapter');
const normalAxios = axios.create();
const mockAxios = axios.create();
import url_config from "./config";
import reqTools from "../utils/reqTools";

// mock 数据   平台 声波锁离线版
var mock = new MockAdapter(mockAxios);

mock.onGet('/queryAll').reply((config) => {
  config.type="10"
  return new Promise(function(resolve, reject) {
    reqTools.get('/api/hardInfo',
    config).then((res) => {
      resolve([200, res.data]);
    }).catch((err) => {
      resolve([500, err ]);
    });
  });

});


export const chartData = [
  {"time": '周一',"tem": 10,"city": "beijing"},
  {"time": '周二',"tem": 22,"city": "beijing"},
  {"time": '周三',"tem": 20,"city": "beijing"},
  {"time": '周四',"tem": 26,"city": "beijing"},
  {"time": '周五',"tem": 20,"city": "beijing"},
  {"time": '周六',"tem": 26,"city": "beijing"},
  {"time": '周日',"tem": 28,"city": "beijing"},
  {"time": '周一',"tem": 5,"city": "newYork"},
  {"time": '周二',"tem": 12,"city": "newYork"},
  {"time": '周三',"tem": 26,"city": "newYork"},
  {"time": '周四',"tem": 20,"city": "newYork"},
  {"time": '周五',"tem": 28,"city": "newYork"},
  {"time": '周六',"tem": 26,"city": "newYork"},
  {"time": '周日',"tem": 20,"city": "newYork"}
];

export const pieData = [{pointer: '开门使用率',value: 5, length:2,y:1.05}];

export const barData = [
  {"time":"周一","tem":6.9,"city":"tokyo"},
  {"time":"周二","tem":9.5,"city":"tokyo"},
  {"time":"周三","tem":14.5,"city":"tokyo"},
  {"time":"周四","tem":18.2,"city":"tokyo"},
  {"time":"周五","tem":21.5,"city":"tokyo"},
  {"time":"周六","tem":25.2,"city":"tokyo"},
  {"time":"周日","tem":26.5,"city":"tokyo"}
];